/*
 * -------------------------------------------------------------------------
 * parameters.h -- watermark, synchronization and logarithmic parametrization
 * Speech Watermarking
 * Copyright (C) 2011-2012  Oriol Parera Fiestas
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 * -------------------------------------------------------------------------
 */


#define TEST_SYNCHRONIZATION 0
#define TEST_WATERMARKING 0

/* DWT */
#define DBXX 14
#define DBXX_STR "db14"
//#define METHOD SYMH
#define METHOD SYMH
/* SYMH ASYMH extension_identity ei[] = {
  {"zpd", ZPD}, {"symh", SYMH}, {"symw", SYMW},
  {"asymh", ASYMH}, {"asymw", ASYMW}, {"sp0", SP0},
  {"sp1", SP1}, {"ppd", PPD}, {"per", PER},
  {"spd", SP1}, {"sym", SYMH}, {"asym", ASYMH},
  {"ZPD", ZPD}, {"SYMH", SYMH}, {"SYMW", SYMW},
  {"ASYMH", ASYMH}, {"ASYMW", ASYMW}, {"SP0", SP0},
  {"SP1", SP1}, {"PPD", PPD}, {"PER", PER},
  {"SPD", SP1},  {"SYM", SYMH}, {"ASYM", ASYMH} 
 */

#define FILTER_LEN DBXX*2
/* DWT CONSTANTS */
//Number of bytes for the header. 1 byte means 8 bits so 2^8 => 256 bits for send into the mark (so 32 bytes for sending)
#define MARK_HEADER_NBYTES   1
//The best MARK_SAMPLES is some 2^n number
#define MARK_SAMPLES         256
//This value should not be over the half of the MARK_SAMPLES
#define MARK_BITS_TO_CODE    8
#define LOG_DELTA 5
#define LOG_SCALE 1000.0
//#define LOG_DELTA 1.0
//#define LOG_SCALE 1.0

/* CHANGE THIS PARAMETERS FOR CHANGE THE BUFFER SIZE OR THE APPLIED FILTER */
/* FRAME */
//#define MOSTRES 128
#define MOSTRES MARK_SAMPLES

#define DWT_SIGINTEMP_LEN MOSTRES+2*FILTER_LEN
#define DWT_APPROXPRE_LEN MOSTRES+FILTER_LEN-1
#define DWT_APPROXTEMP_LEN DWT_SIGINTEMP_LEN+FILTER_LEN-1

#define IDWT_SIGIN_LEN 2*SPEC_SIZE+1
#define IDWT_SIGOUT_LEN IDWT_SIGIN_LEN+FILTER_LEN-1

//#define SPEC_SIZE (int)floor((MOSTRES+FILTER_LEN-1)/2)
#define SPEC_SIZE (int)((MOSTRES+FILTER_LEN-1)/2)

#define DWT_CONVOLUTION_BUFFER_1 MOSTRES+4*(FILTER_LEN)-2 
#define DWT_CONVOLUTION_BUFFER_2 2*SPEC_SIZE+2*FILTER_LEN-1


#define MARK_SPEC_SAMPLES    MARK_SAMPLES+FILTER_LEN-1
#define MARK_SPEC_HALF_SAMPLES    SPEC_SIZE
#define MARK_SPEC_SAMPLES_PER_BIT MARK_SPEC_HALF_SAMPLES/MARK_BITS_TO_CODE

/* SYN */

/* Parametrizable */
#define SYN_PHI 0.5
//#define SYN_PHI 0.05
#define SYN_MIN_TETA 0.5
//#define SYN_MIN_TETA 0.5
//#define SYN_MESSAGE 0x11223344
#define SYN_MESSAGE 0x4b871e2d
//#define SYN_MESSAGE 0xffffffff
#define SYN_NBYTES  4 //MAX IS 4... it is sizeof(uint32_t)
#define SYN_SAMPLES_PER_BIT 4

/* Constant calculations */
#define SYN_NBITS    SYN_NBYTES*8
#define SYN_NSAMPLES SYN_NBITS*SYN_SAMPLES_PER_BIT //64 muestras (2 bytes)
#define SYN_SIZE     SYN_NSAMPLES*sizeof(short)

